package com.by.controller;
import cn.hutool.core.bean.BeanUtil;
import com.by.bean.Dept;
import com.by.common.bean.Page;
import com.by.common.bean.PageBean;
import com.by.common.bean.ResultBean;
import com.by.common.controller.BaseController;
import com.by.mapper.DeptMapper;
import com.by.query.EmpQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api")
@Api(tags = "部门")
public class DeptController extends BaseController {
    @Autowired
    private DeptMapper deptMapper;

    // 部门列表
    @ApiOperation("查询部门列表")
    @PostMapping("/dept/list/{id}")
    public ResultBean query(@PathVariable(required = true) int id) {
        List<Dept> depts = deptMapper.queryChild(id);
//        return depts;
        return success("客户列表", depts);
    }

}
